x11: Handle all XI2 crossing mode values in switch
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 4 Dec 2013 11:34:31 +0000 (12:34 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 5 Dec 2013 02:22:23 +0000 (21:22 -0500)
This fixes potential assertions if a GTK+ app gets to receive
a XINotifyPassiveGrab/Ungrab pointer crossing event, currently
triggerable by XIGrabEnter passive grabs.

http://bugzilla.gnome.org/show_bug.cgi?id=719762

gdk/x11/gdkdevicemanager-xi2.c

index b4e3c19ccae148a375f5c65274c3397dcdb33ecf..6c525b9ee4604744437c7fb702b5d9a21b6103a7 100644 (file)
@@ -780,12 +780,16 @@ translate_crossing_mode (gint mode)
 {
   switch (mode)
     {
-    case NotifyNormal:
+    case XINotifyNormal:
       return GDK_CROSSING_NORMAL;
-    case NotifyGrab:
+    case XINotifyGrab:
+    case XINotifyPassiveGrab:
       return GDK_CROSSING_GRAB;
-    case NotifyUngrab:
+    case XINotifyUngrab:
+    case XINotifyPassiveUngrab:
       return GDK_CROSSING_UNGRAB;
+    case XINotifyWhileGrabbed:
+      /* Fall through, unexpected in pointer crossing events */
     default:
       g_assert_not_reached ();
     }